package com.zhiyou100.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhiyou100.mapper.SpeakerMapper;
import com.zhiyou100.model.Speaker;
import com.zhiyou100.service.SpeakerService;
@Service
public class SpeakerServiceImpl implements SpeakerService{
	@Autowired
	private SpeakerMapper ss;
	@Override
	public Speaker selectSpeakers(Integer speaker_id) {
		// TODO Auto-generated method stub
		return ss.selectSpeakers(speaker_id);
	}
	@Override
	public List<Speaker> selectSpeakerAll() {
		// TODO Auto-generated method stub
		return ss.selectSpeakerAll();
	}
	@Override
	public PageInfo<Speaker> selectSpeakerPage(Integer pageNum,Integer pageSize) {
		PageHelper.startPage(pageNum,pageSize);
		List<Speaker> speakers = ss.selectSpeakerAll();
		PageInfo<Speaker> pageInfo = new PageInfo<>(speakers);
		return pageInfo;
	}
	@Override
	public PageInfo<Speaker> selectSpeakerByContent(Integer pageNum, int pageSize, Speaker speaker) {
		PageHelper.startPage(pageNum,pageSize);
		List<Speaker> speakers = ss.selectSpeakerByContent(speaker);
		PageInfo<Speaker> pageInfo = new PageInfo<>(speakers);
		return pageInfo;
	}
	@Override
	public int updateSpeaker(Speaker speaker) {
		// TODO Auto-generated method stub
		return ss.updateSpeaker(speaker);
	}
	@Override
	public int addSpeaker(Speaker speaker) {
		// TODO Auto-generated method stub
		return ss.addSpeaker(speaker);
	}
	@Override
	public int deleteSpeaker(Integer id) {
		// TODO Auto-generated method stub
		return ss.deleteSpeaker(id);
	}

}
